//
//  RecommendCollectionViewCell.m
//  Cooking
//
//  Created by ZhiPeng.Y on 15/8/27.
//  Copyright (c) 2015年 ZP.Y. All rights reserved.
//

#import "RecommendCollectionViewCell.h"
#import "AppMacro.h"
#import "RecommendModel.h"
#import "UIImageView+WebCache.h"

@interface RecommendCollectionViewCell ()

@property (retain, nonatomic) UIImageView *foodImage;

@end

@implementation RecommendCollectionViewCell

- (void)dealloc {
    [_foodImage release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.foodImage = [[UIImageView alloc] init];
//    _foodImage.backgroundColor = [UIColor grayColor];
    [self.contentView addSubview:_foodImage];
    [_foodImage release];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _foodImage.frame = CGRectMake(0, 0, WIDTH, HEIGHT - 64 - 49);
}

- (void)sendValueWithModel:(RecommendModel *)recommendModel {
    [_foodImage sd_setImageWithURL:[NSURL URLWithString:recommendModel.imagePathLandscape] placeholderImage:[UIImage imageNamed:@"zhanwei_01.png"]];
}


@end
